<template>
    <div :class="['com-button', type]" v-on:click="onClick">
        <slot/>
    </div>
</template>

<script>
export default {
    name: 'comButton',
    props: {
        type: {
            type: String,
            required: false
        }
    },
    methods: {
    onClick (e) {
      console.log('o_________o')
      this.$emit('click1',e)
    }
  }
}
</script>

<style scoped lang="scss">
.com-button {
    width: 80px;
    height: 40px;
    line-height: 40px;
    color: bisque;
    background: pink;
    border-radius: 10px;
    cursor: pointer;
    &:hover{
        background: cornflowerblue;
    }
    &:active{
        background: coral
    }
}

.error{
    background: brown;
}
.success{
    background: darkseagreen;
}
</style>